package pattern.creational.builder;

/**
 * @author: chaoyang.ren
 * @date:Jul 13, 2017
 * @time:3:32:52 PM
 * @email:chaoyang.ren@foxmail.com
 * @version: 1.0
 */
public class Director {
	private Builder builder;

	// 构造方法中也可以传递builder
	public Director(Builder builder) {
		this.builder = builder;
	}

	// 传递builder
	public void setBuilder(Builder builder) {
		this.builder = builder;
	}

	// 这个方法用来规范流程，产品构建和组装方法
	public void construct() {
		builder.buildPartA();
		builder.buildPartB();
		builder.buildPartC();
	}
}
